package com.tlgen.common.utils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import java.util.Objects;

/**功能描述：获取 HttpServletRequest
 * @Auther:http://www.xueden.cn
 * @Date:2020/3/23
 * @Description:cn.xueden.common.utils
 * @version:1.0
 */
public class RequestHolder {

    public static HttpServletRequest getHttpServletRequest() {
        return ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
    }
}
